# FROM node:current-alpine3.12 as build
FROM node:14.18.1-alpine as base
WORKDIR /app
# refer to : https://yeasy.gitbook.io/docker_practice/image/dockerfile/arg
ARG TimeZone=Asia/Shanghai

ENV NODE_ENV=production \
    TZ=${TimeZone}

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

FROM node:14.18.1-alpine as install
WORKDIR /app

COPY . .

RUN yarn config get registry && yarn install --production --silent

FROM base as final
ARG ContainerPort=8231
EXPOSE ${ContainerPort}

COPY --from=install /app /app



CMD ["node", "--max-http-header-size=262144", "./modules/app.server.js"]
